package uit.server.util;

import java.util.ResourceBundle;

public class ArcIMSUtil {
	
	private final static String  MAP_PROPERTIES = "map";
	
	
	public ResourceBundle getResourceBundle(String propertyfile){
		ResourceBundle rb = null;
		try{
			rb = ResourceBundle.getBundle(propertyfile);
		}catch (Exception e){
			e.printStackTrace();
		}
		return rb;
	}
	
	
	public String getPropertyValue(String propertyfile , String name){
		String  value = "";
		ResourceBundle rb = getResourceBundle(propertyfile);
		value = (String)rb.getString(name);
		return value;
	}
	
	public int getPropertyIntValue(String propertyfile , String name){
		String  value = "";
		ResourceBundle rb = getResourceBundle(propertyfile);
		value = (String)rb.getString(name);
		return  Integer.parseInt(value);
	}
	
	public String getPropertyValue( String name){
		return getPropertyValue(MAP_PROPERTIES , name);
	}
	
	public int getPropertyIntValue( String name){
		return getPropertyIntValue(MAP_PROPERTIES , name);
	}
}
